<?php

namespace yiike\credit\app\controllers;

use Yii;
use \yiike\credit\models\Credit;
use \yiike\credit\models\CreditRecord;

/**
 * This is the class for controller "CreditController".
 */
class MyController extends \yii\web\Controller {

    public function behaviors()
    {
        return [
            'access' => [
                'class' => \yii\filters\AccessControl::className(),
                'rules' => [
                    [
                        'allow' => true,
                        'roles' => ['@'],
                    ],
                ],
            ],
        ];
    }
    public function actionIndex() {
        $model           = Credit::findOne(Yii::$app->user->id);
        
        return $this->render('index', ['model' => $model]);
    }

}
